//对外暴露配置路由(常量路由)
export const constantRoute = [
    {
        //注册
        path: '/register',
        component: () => import('@/views/register/index.vue'),
        name: 'register', //命名路由
        meta: {
            title: '注册', //菜单标题
            hidden: true
        }
    },
    {
        //登录
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login', //命名路由
        meta: {
            title: '登录', //菜单标题
            hidden: true
        }
    },
    {
        //登录成功以后展示数据的路由
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        meta: {
            title: '',
            hidden: false,
            icon: ''
        },
        redirect: '/login',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: '首页',
                    hidden: true,
                    icon: 'House'
                }
            }
        ]
    },
    {
        path: '/screen',
        component: () => import('@/views/screen/index.vue'),
        name: 'Screen',
        meta: {
            hidden: false,
            title: '数据大屏',
            icon: 'Monitor'
        }
    },
    {
        path:'/self',
        component: ()=> import('@/views/self/index.vue'),
        name:'self',
        meta:{
            hidden: true,
            title:'个人中心'
        }
    },
    {
        path: '/acl',
        component: () => import('@/layout/index.vue'),
        name: 'Acl',
        meta: {
            hidden: false,
            title: '权限管理',
            icon: 'Lock',
            permission: ['admin'] // 只有admin权限可见
        },
        redirect: '/acl/user',
        children: [
            {
                path: '/acl/user',
                component: () => import('@/views/acl/user/index.vue'),
                name: 'User',
                meta: {
                    title: '用户管理',
                    hidden: false,
                    icon: 'User',
                    permission: ['admin']
                }
            },
            {
                path: '/acl/role',
                component: () => import('@/views/acl/role/index.vue'),
                name: 'Role',
                meta: {
                    title: '角色管理',
                    hidden: false,
                    icon: 'UserFilled',
                    permission: ['admin']
                }
            },
            {
                path: '/acl/permission',
                component: () => import('@/views/acl/permission/index.vue'),
                name: 'Permission',
                meta: {
                    title: '菜单管理',
                    hidden: false,
                    icon: 'Platform',
                    permission: ['admin']
                }
            }
        ]
    },
    {
        path: '/product',
        component: () => import('@/layout/index.vue'),
        name: 'Product',
        meta: {
            hidden: false,
            title: '商品管理',
            icon: 'Goods'
        },
        redirect: '/product/list',
        children: [
            {
                path: '/product/list',
                component: () => import('@/views/product/index.vue'),
                name: 'ProductList',
                meta: {
                    title: '商品列表',
                    hidden: false,
                    icon: 'List'
                }
            },
            {
                path: '/product/category',
                component: () => import('@/views/product/category/index.vue'),
                name: 'ProductCategory',
                meta: {
                    title: '商品分类',
                    hidden: false,
                    icon: 'Menu'
                }
            },
            {
                path: '/product/attribute',
                component: () => import('@/views/product/attribute/index.vue'),
                name: 'ProductAttribute',
                meta: {
                    title: '商品属性',
                    hidden: false,
                    icon: 'Tickets'
                }
            }
        ]
    },
    {
        //404
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true,
            icon: 'SwitchButton'
        }
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            title: '任意路由',
            hidden: true,
            icon: 'Operation'
        }
    }
]
